package io.aircraft.modules.wms.service.impl;

import io.aircraft.common.utils.ProcResult;
import io.aircraft.modules.wms.dao.StoredProcDao;
import io.aircraft.modules.wms.entity.stored.*;
import io.aircraft.modules.wms.service.StoredProcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StoredProcServiceImpl implements StoredProcService {
    @Autowired
    private StoredProcDao storedProcDao;

    @Override
    public ProcResult purchaseCancelById(ProcPurchaseCancelEntity parameters) {
        storedProcDao.procWmsPurchaseCancel(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult purchaseDoneById(ProcPurchaseDoneEntity parameters) {
        storedProcDao.procWmsPurchaseDone(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult orderCancelById(ProcOrderCancelEntity parameters) {
        storedProcDao.procWmsOrderCancel(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult autoAllotByWave(ProcWaveAllotEntity parameters) {
        storedProcDao.procWmsWaveAllot(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult autoAllotById(ProcOrderAllotEntity parameters) {
        storedProcDao.procWmsOrderAllot(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult refundById(ProcOrderRefundEntity parameters) {
        storedProcDao.procWmsOrderRefund(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult audiByWave(ProcWaveAudiEntity parameters) {
        storedProcDao.procWmsWaveAudi(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult audiById(ProcOrderAudiEntity parameters) {
        storedProcDao.procWmsOrderAudi(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult affirmByTask(ProcTaskAffirmEntity parameters) {
        storedProcDao.procWmsTaskAffirm(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }

    @Override
    public ProcResult stockCheck(ProcStockCheckEntity parameters) {
        storedProcDao.procWmsStockCheck(parameters);
        return new ProcResult().result(parameters.getCode(), parameters.getMsg());
    }
}
